<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script >
    function fun(n,o){
        console.log( o)
        return  {
            fun :function (m){
                return fun(m,n)
            }
        }
    }



    console.log( fun(0))

    let a=fun(0).fun(1)

    console.log("**********   ")
    console.log(a)


    // 对象的方法重复调用
    a.fun(2)
    a.fun(3)

    console.log(a)

    //每次都是新对象调用方法
    let b=fun(0).fun(1).fun(2).fun(3)
</script>
</body>
</html>